# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

inherit eutils qt4 subversion flag-o-matic
MY_PN="${PN/qutim-/}"

DESCRIPTION="qutim-libnotify provides popups for pidgin via a libnotify interface"
HOMEPAGE="http://code.google.com/p/qutim-libnotify/"
LICENSE="GPL-2"
SVN_REV_NUMBER=4
ESVN_REPO_URI="http://qutim-libnotify.googlecode.com/svn/trunk/@${SVN_REV_NUMBER}"

SLOT="0.2"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
IUSE="debug"

RDEPEND="x11-misc/notification-daemon"

DEPEND="${RDEPEND}
	net-im/qutim:0.2
	dev-cpp/gtkmm
        dev-cpp/glibmm
        !x11-plugins/qutim-kdeintegration[notification]
	!x11-plugins/qutim-libnotify:live"

RESTRICT="debug? ( strip )"

src_unpack()
{
	subversion_src_unpack
}

src_prepare()
{
	sed -i "/TARGET/s/qutim-libnotify/libnotify/g" ${S}/qutim-libnotify.pro

	if (use debug) ; then
		unset CFLAGS CXXFLAGS
		append-flags -O1 -g -ggdb
	fi
}

src_compile() 
{
	eqmake4 ${PN}.pro || die "Failed ICQ plugin configure"
	emake || die "Failed ICQ plugin build"
}

src_install()
{
 	insinto /usr/$(get_libdir)/qutim
 	doins "${WORKDIR}/${PN}-${PV}/lib${MY_PN}.so" || die "Plugin installation failed"
}
